<?php

namespace app\home\controller;

use app\company\service\DataService;
use library\Controller;
use think\Db;
use app\common\controller\Email;
use app\common\controller\Get;
use app\common\controller\Common;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Shared\Date;

/**
 * 仓库商品列表
 * @package app\worker\controller
 */
class WhProduct extends Controller
{

    /**
     * 仓库商品列表
     * @auth true
     * @menu true
     */
    public function index()
    {
        $this->title = '仓库商品列表';
        $this->ware_house_id = request()->get('ware_house_id');
        $query = $this->_query('product_warehouse')
            ->alias('pw')
            ->join('product p','p.id=pw.product_id','left')
            ->where('pw.ware_house_id', $this->ware_house_id)
            ->like('p.name')
            ->field('p.*,pw.count,pw.ware_house_id')
            ->order('pw.create_at desc,pw.id desc');
        $query->page();
    }

    protected function _index_page_filter(&$data)
    {
    }
}
